<template>
<div class="tinymce-editor">
<TinymceEditor v-model="myValue" :init="init" :api-key="apiKey" :disabled="disabled" />
<button @click="onClick()">测试</button>
</div>
</template>

<script>
import TinymceEditor from '@/components/Tinymce/index.vue';

export default {
components: { TinymceEditor },
data() {
return {
apiKey: 'your-api-key',
init: {
language_url: '/tinymce/langs/zh-Hans.js',
language: 'zh_CN',
height: 500,
plugins: 'image media table link code',
toolbar: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | bullist numlist outdent indent | image media link code',
},
myValue: '',
disabled: false,
};
},
methods: {
onClick() {
console.log(tinymce.editors[0].getContent());
},
},
};
</script>

<style scoped>
tinymce-editor {
padding: 0 100px;
}
</style>